import request from '@/router/axios';

export const getList = (page, size, params) => {
    return request({
        url: '/base/sellerSupplier/list',
        method: 'post',
        params: {
            ...params,
            page,
            size,
        }
    })
}
export const remove = (id) => {
    return request({
        url: '/base/sellerSupplier/delete',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            id,
        }
    })
}

export const saveItem = (row) => {
    return request({
        url: '/base/sellerSupplier/saveItem',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: row
    })
}


export const setSupplierUser = (setForm) => {
    return request({
        url: '/api/mgr/addSupplier',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: setForm
    })
}

export const editItem = (setForm) => {
    return request({
        url: '/api/mgr/edit',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: setForm
    })
}

export const detail = (setForm) => {
    return request({
        url: '/api/mgr/getSupplierDetail',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: setForm
    })
}

export const changeStatus = (userId, status) => {
    return request({
        url: '/base/supplier/changeStatus',
        method: 'post',
        meta: {
            isSerialize: true,
        },
        data: {
            userId,
            status
        }
    })
}